// pages/check/property/detail/detail.js
Page({

	/**
	 * 页面的初始数据
	 */
	data: {
		pg: 1,
		startTime: '',
		endTime: '',
		time:'开始时间',
		time1:'结束时间',
		data:[]
	},

	/**
	 * 生命周期函数--监听页面加载
	 */
	onLoad: function(options) {
		wx.getStorage({
			key: 'uid',
			success: (e) => {
				this.setData({
					uid: e.data.uid
				})
				this.push()
			}
		})

	},
	push() {
		let a=this.data.data
		wx.request({
			url: getApp().globalData.http1 + 'action=getCapitalMx&uid=' + this.data.uid + '&pg=' + this.data.pg +
				'&startTime=' + this.data.startTime +
				'&endTime=' + this.data.endTime,
			success: (e) => {
				console.log(e.data.data)
				let pd = 0
				if (e.data.data.length < 15) {
					pd = 1
				}
				e.data.data.forEach(function(item,index){
					a.push(item)
				})
				this.setData({
					data: a,
					pd: pd
				})
			}
		})
	},
	bindTimeChange: function(e) {
		this.setData({
			time: e.detail.value,
			startTime: e.detail.value,
		})
	},
	bindTimeChange1: function(e) {
		this.setData({
			time1: e.detail.value,
			endTime: e.detail.value,
		})
	},
	ovo() {
		if (this.data.pd == 1) {
			this.setData({
				pg: this.data.pg + 1
			})
			this.push()
		}
	},
	sure(){
		this.setData({
			pg:1,
		})
		this.push()
	}
})
